<script>
	export default {
		onLaunch: function() {},
		onShow: function() {
			let token = uni.getStorageSync("token")
			if (!token) {
				uni.reLaunch({
					url: "/pages/login/login"
				})
			}
		},
		mounted() {
			console.log(this.$store)
			if(this.$store.state.user.userInfo.id){
				this.$store.dispatch('user/timLogin')
			}
			// #ifdef H5
			window.$store=this.$store
			// #endif
			uni.$user={
				chat:(e)=>{
					this.$store.commit('user/chat',e)
				}
			}
		},
		onHide: function() {}
	}
</script>

<style lang="scss">
	/*每个页面公共css */
	@import '@/uni_modules/uni-scss/index.scss';
	@import '@/static/customicons.css';

	// 设置整个项目的背景色
	page {
		background: linear-gradient(to bottom, #96ea6f, #f8f8f8, #f8f8f8, #f8f8f8, #f8f8f8, #f8f8f8);
		height: 100%;
	}
</style>